#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
const int MAXN=50;
long long q[MAXN];
int main(void){
    q[1]=3;
    q[2]=8;
    for(int i=3;i<=40;i++){
        q[i]=2*(q[i-1]+q[i-2]);
    }
    int n;
    while(~scanf("%d",&n)){
        printf("%lld\n",q[n]);
    }
    return 0;
}